<template>
	<view>
		<block v-if="orderList.length > 0">
			<uni-card :is-shadow="false" margin="20rpx 20rpx" padding="0 0 20rpx 0" :border="false"
				v-for="(item,index) in orderList" :key="item.id" @click="toDetail(item)">
				<template v-slot:title>
					<uni-section class="decoration" :title="item.Business_name.name" type="line">
						<template v-slot:right>
							<u-text text="已下单" bold color="#999"></u-text>
						</template>
					</uni-section>
				</template>
				<uni-list :border="true">
					<uni-list-item :title="'商品名称'+item.Commotidy[0].name" :note="'下单时间'+item.time"
						thumb="https://vkceyugu.cdn.bspapp.com/VKCEYUGU-dc-site/460d46d0-4fcc-11eb-8ff1-d5dcf8779628.png"
						thumb-size="lg">
					</uni-list-item>
				</uni-list>
				<template v-slot:actions>
					<u-row>
						<u-col span="8">
							<u-row>
								<u-col span="5">
									<u--text lineHeight="40" type="info" align="right" text="订单金额:"></u--text>
								</u-col>
								<u-col span="5">
									<u--text lineHeight="40" :text="item.price+'元'"></u--text>
								</u-col>
							</u-row>
						</u-col>
						<u-col span="4">
							<u-button shape="circle" size="small" text="评价" customStyle="width:120rpx"
								@click.stop="toComment(item)"></u-button>
						</u-col>
					</u-row>
				</template>
			</uni-card>
			<u-loadmore :status="loadMoreStatus"></u-loadmore>
		</block>
		<block v-else>
			<u-empty marginTop="200">
			</u-empty>
		</block>
	</view>

</template>

<script>
	export default {
		props: {
			orderList: Array,
			role_info: String,
			getType: Number,
			loadMoreStatus: String
		},
		data() {
			return {

			}
		},
		onLoad(e) {

		},
		methods: {
			// 订单详情
			toDetail(item) {
				this.$emit('toDetail', item)
			},
			// 评价
			toComment(item) {
				this.$emit('toComment', item)
			}
		}
	}
</script>

<style scoped>
	.uni-section .uni-section-header__decoration {
		margin-right: 6px;
		background-color: #ffd100;
	}
</style>